;#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
;use Input mode cause Alt+Up incorrect on windows resource manager
;SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
Process ,Priority, ,High

x := 0
y := 0
keyCount := 0
$Esc::
title := 
WinGetActiveTitle title
title := Trim(title)
subTitle :=
StringRight subTitle, title, 13

if(subTitle == "Visual Studio")
{
	global x, y, keyCount
	if(keyCount == 0)
	{
		MouseGetPos x, y
		MouseMove x, 0, 0
	}
	Send {Esc}
	keyCount := keyCount + 1	
	interval := 600*keyCount
	SetTimer MoveBack, %interval%
}
else
{
	Send {Esc}
}
return

MoveBack:
	global x, y
	MouseMove x, y, 0
	keyCount = 0
	SetTimer MoveBack, Off
return